pkg_name=dash
version=0.5.8
build_dir=$builds_dir_root/$pkg_name-cross-$version
src_dir=$src_dir_root/$pkg_name-$version
#futur version may require git
url=http://gondor.apana.org.au/~herbert/$pkg_name/files/$pkg_name-$version.tar.gz

rm -Rf "$src_dir"
cd "$src_dir_root"
tar zxf "$pkg_name-$version.tar.gz"

rm -Rf "$build_dir"
mkdir -p "$build_dir"
cd "$build_dir"

export CFLAGS=-O0
#we get rid of libc fnmatch and glob support since it's not properly supported
#for things like dir*/dir*/foo
"$src_dir/configure"		\
	--build=ZOB		\
	--host=$gnu_target	\
	--prefix=/		\
	--sbindir=/bin		\
	--disable-fnmatch	\
	--disable-glob

make

install_tmp_dir=/tmp/$pkg_name-cross-$version
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

unset CFLAGS

install_dirs_in_sysroot "$builders_dir_root/$pkg_name/runtime-cross.dirs" "$sysroot/"
install_files_in_sysroot "$builders_dir_root/$pkg_name/runtime-cross.files" "$install_tmp_dir/" "$sysroot/"
#don't forget sh symbolic link in /bin to $pkg_name
install_links_in_sysroot "$builders_dir_root/$pkg_name/runtime-cross.links" "$sysroot/"
elf_strip_in_sysroot "$builders_dir_root/$pkg_name/elf-strip-cross" "$sysroot/"

rm -Rf "$install_tmp_dir"
rm -Rf "$build_dir"
rm -Rf "$src_dir"
